package com.yixun.qfbao.interceptor.forbidrepeatclick.response;

import org.apache.commons.lang.StringUtils;

/**
 * @author zilong.liu
 * @date 2020-11-23
 *
 * desc:
 *     
 */
public enum ResponseTypeEnum {
	
	STRING_TYPE_ENUM("java.lang.String","stringTypeResponse"),
	BASE_RESPONSE_TYPE_ENUM("com.yixun.qfbao.response.BaseResponse","baseResponseTypeResponse");
	
	private final String resType;
	private final String resBeanName;
	
	/**
	 * 私有构造函数
	 * @param no
	 * @param des
	 */
	ResponseTypeEnum(String resType, String resBeanName) {
		this.resType = resType;
		this.resBeanName = resBeanName;
	}
	
	public static String getBeanNameByResType(String resType) {
		if(StringUtils.isBlank(resType)){
			return null;
		}
		for (ResponseTypeEnum responseTypeEnum : values()) {
			if (responseTypeEnum.getResType().equals(resType)) {
				return responseTypeEnum.getResBeanName();
			}
		}
		return null;
	}

	public String getResType() {
		return resType;
	}

	public String getResBeanName() {
		return resBeanName;
	}
	
	

}
